import {
	request
} from "@/utils/request.js"

// 订单
export function confrim(data) {
	return request({
		url: "/jeecg-customer/order/app/confirm",
		data,
	})
}

export function pageList(data) {
	return request({
		url: '/jeecg-customer/order/app/page',
		data,
	})
}

export function orderReceive(data) {
	return request({
		url: `/jeecg-customer/order/app/orderReceive?orderId=${data}`,
	})
}

export function orderDetail(data) {
	console.log(data);
	return request({
		url: `/jeecg-customer/order/app/queryDetail?orderId=${data}`,
		method: 'get'
	})
}

export function submitAdd(data) {
	return request({
		url: '/jeecg-customer/order/app/submit',
		data
	})
}

export function takePhone(data) {
	return request({
		url: `/jeecg-customer/user/customer/storePhone/${data}`,
		method: 'get'
	})
}
// 地址
export function allAddress(data) {
	return request({
		url: `/jeecg-customer/address/list/${data}`,
		method: "get"
	})
}

export function addAddress(data) {
	return request({
		url: '/jeecg-customer/address/add',
		data,
	})
}

export function delAddress(data) {
	return request(({
		url: '/jeecg-customer/address',
		data,
	}))
}

export function editAddress(data) {
	return request({
		url: '/jeecg-customer/address',
		method: "put",
		data,
	})
}

export function changdefault(data) {
	return request({
		url: '/jeecg-customer/address/default',
		method: 'put',
		data
	})
}

// 用户
export function user(data) {
	return request({
		url: '/jeecg-customer/user/customer/set',
		data,
	})
}

export function userList(data) {
	return request({
		url: `/jeecg-customer/user/customer/queryById?id=${data}`,
		method: 'get'
	})
}

export function getPhone(data) {
	return request({
		url: `/jeecg-customer/user/customer/platformPhone?id=${data}`,
		method: 'get'
	})
}

// 邀请
export function inviNum(data) {
	return request({
		url: `/jeecg-customer/user/customerInvite/queryInviteNum/${data}`,
		method: 'get',
	})
}

export function inviList(data) {
	return request({
		url: '/jeecg-customer/user/customerInvite/list',
		data,
	})
}

export function inviUser(data) {
	return request({
		url: '/jeecg-customer/user/customerInvite/queryInvite',
		data,
	})
}

export function getAddress(data) {
	return request({
		url: `/jeecg-customer/address/query/${data}`,
		method: 'get',
	})
}

// 取消支付
export function orderCancel(data) {
	return request({
		url: `/jeecg-customer/order/app/orderCancel`,
		data,
	})
}
// 取消支付
export function isAddCart(data) {
	return request({
		url: `/jeecg-customer/order/app/isAddCart`,
		data,
	})
}